package com.haruhinav.service.impl;

import com.haruhinav.entity.StartNav;
import com.haruhinav.mapper.StartNavMapper;
import com.haruhinav.service.StartNavService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class StartNavServiceImpl implements StartNavService {

    @Resource
    private StartNavMapper startNavMapper;

    /**
     * 获取用户的所有nav
     * @param userId
     * @return
     */
    @Override
    public List<StartNav> getListByUser(Integer userId) {

        return startNavMapper.getListByUser(userId);
    }

    /**
     * 获取默认
     * @return
     */
    @Override
    public List<StartNav> getDefaultNavs() {

        return startNavMapper.getDefaultNavs();
    }
    /**
     * 修改by user and createTime
     * @param nav
     * @return
     */
    @Override
    public int updateNavByUser(StartNav nav) {
        return startNavMapper.updateNavByUser(nav);

    }
    /**
     * 添加
     * @param nav
     * @return
     */
    @Override
    public int addNav(StartNav nav) {


        return startNavMapper.addNav(nav);

    }

    /**
     * 删除
     * @param nav
     * @return
     */
    @Override
    public int delNavByUser(StartNav nav) {
        return startNavMapper.delNavByUser(nav);
    }
}
